3D ray tracing